<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../lib/vue.js"></script>
    <script src="../lib/vue-resource.js"></script>
</head>

<body>
    <div id="app">
        <input type="button" value="get请求" @click="getUser" />
        <input type="button" value="post请求" />
        {{ user }}
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                user: ''
            },
            methods: {
                getUser() {
                    this.$http.post('http://127.0.0.1:8082/user',{"id":7})
                        .then(
                            result => {
                                alert(JSON.stringify(result.body))
                            })
                    
                }
            },
            directives: {},
            filters: {}
        })
    </script>
</body>

</html>